Optimal. Leaf size=33 \[ \frac{a^2 \sin (c+d x)}{d}+2 a b x+\frac{b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0554316, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {3788, 8, 4045, 3770} \[ \frac{a^2 \sin (c+d x)}{d}+2 a b x+\frac{b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3788
Rule 8
Rule 4045
Rule 3770
Rubi steps
\begin{align*} \int \cos (c+d x) (a+b \sec (c+d x))^2 \, dx &=(2 a b) \int 1 \, dx+\int \cos (c+d x) \left (a^2+b^2 \sec ^2(c+d x)\right ) \, dx\\ &=2 a b x+\frac{a^2 \sin (c+d x)}{d}+b^2 \int \sec (c+d x) \, dx\\ &=2 a b x+\frac{b^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a^2 \sin (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.0159462, size = 46, normalized size = 1.39 \[ \frac{a^2 \sin (c) \cos (d x)}{d}+\frac{a^2 \cos (c) \sin (d x)}{d}+2 a b x+\frac{b^2 \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.043, size = 49, normalized size = 1.5 \begin{align*} 2\,abx+{\frac{{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}\sin \left ( dx+c \right ) }{d}}+2\,{\frac{abc}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.17769, size = 69, normalized size = 2.09 \begin{align*} \frac{4 \,{\left (d x + c\right )} a b + b^{2}{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.68157, size = 131, normalized size = 3.97 \begin{align*} \frac{4 \, a b d x + b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec{\left (c + d x \right )}\right )^{2} \cos{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.36628, size = 105, normalized size = 3.18 \begin{align*} \frac{2 \,{\left (d x + c\right )} a b + b^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - b^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) + \frac{2 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]